﻿<Window x:Class="WpfExample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:me="clr-namespace:WpfExample"
        xmlns:wu="clr-namespace:Monogram.WpfUtils;assembly=WpfUtils"
        Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
  <Grid Name="LayoutRoot" d:DataContext="{d:DesignData /SampleData/ViewModelSampleData.xaml}"    >
  	<Grid.ColumnDefinitions>
  		<ColumnDefinition />
  		<ColumnDefinition Width="250"/>
  	</Grid.ColumnDefinitions>

    <StackPanel>
      <TextBlock Text="List of persons" />
      <ListView Name="listView1" ItemsSource="{Binding Persons}">
        <ListView.View>
          <GridView>
            <GridViewColumn Header="First Name" DisplayMemberBinding="{Binding FirstName}"  />
            <GridViewColumn Header="Last Name" DisplayMemberBinding="{Binding LastName}"  />
          </GridView>
        </ListView.View>
      </ListView>

      <CheckBox Name="chbxEdit" Content="AllowEdit" Margin="0,20" />
      <Button Content="Anonymous type example" HorizontalAlignment="Left" Click="Button_Click" />
      <Button Content="Custom binding example" HorizontalAlignment="Left"  Margin="0,20" Click="Button_Click_1" />
    </StackPanel>

    <StackPanel Grid.Column="1">
      <wu:DetailsView DataContext="{Binding SelectedItem, ElementName=listView1}"
                      d:DataContext="{Binding Persons[0]}"
                      AllowEdit="{Binding IsChecked, ElementName=chbxEdit}" />
    </StackPanel>
  </Grid>
</Window>
